/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.util.Scanner;

/**
 *
 * @author Pe Bong
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        int choice = 0;
        int i = 0;
        int j = 0;
        String flag = "y";
        Scanner input = new Scanner(System.in);
        input.useDelimiter("\n");
        Employee emp[];
        emp = new Employee[100];
        for (i = 0; i < 100; i++) {
            emp[i] = new Employee();
        }

        do {
            System.out.println("\t***   EMPLOYEE MANAGERMENT   ***");
            System.out.println("\t1.Add new employee");
            System.out.println("\t2.Display all");
            System.out.println("\t3.Exit");
            System.out.println("******************************");
            System.out.println("Enter your choice :");
            choice = input.nextInt();
            
            
           
            switch (choice) {
                case 1:

                        System.out.println("Enter Emp's name :");
                        emp[j].name = input.next();
                        System.out.println("Enter Emp's address :");
                        emp[j].add = input.next();
                        emp[j].standardizeAdd(emp[j].add);
                        System.out.println("Enter Emp's phone number :");
                        emp[j].phone = input.next();
                        emp[j].standardizePhone(emp[j].phone);
                        j++;
                        //System.out.println("Thank for your registration. Do you want to continue ?(y/n) :");
                        //flag = input.next();

                    
                    break;
                case 2:
                    System.out.println("\t *** Employee Detail ***");
                    System.out.println("Name \t Address \t Phone");
                    for (int k = 0; k < j; k++) {
                        
                        emp[k].display();
                    }
                    break;
            }

        } while (choice != 3);
    }
}
